package io.renren.modules.generator.controller;

import io.renren.common.utils.R;
import io.renren.modules.generator.dto.GardenPortraitCommonResult;
import io.renren.modules.generator.service.EnterprisePortraitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author zhangxu
 * @create 2020/9/23
 * Description:
 */
@RestController
@RequestMapping("generator/enterpriseportrait")
@Api("企业画像页面专用接口")
public class EnterprisePortraitController {
    @Autowired
    private EnterprisePortraitService enterprisePortraitService;
    /**
     * 企业概况
     */
    @RequestMapping("/survey")
    @ApiOperation("企业概况")
    public R survey(){
        Map<String,Object> map = enterprisePortraitService.selectSurvey();
        return R.ok().put("data", map);
    }

    /**
     * 企业所属类型统计
     */
    @RequestMapping("/type/statis")
    @ApiOperation("企业所属类型统计")
    public R typestatis(){
        List<GardenPortraitCommonResult> resultList = enterprisePortraitService.selectTypeStatis();
        return R.ok().put("data", resultList);
    }

    /**
     * 企业评价统计分析
     */
    @RequestMapping("/evaluate/statis")
    @ApiOperation("企业评价统计分析")
    public R evaluatestatis(){
        List<GardenPortraitCommonResult> resultList = enterprisePortraitService.selectEvaluateStatis();
        return R.ok().put("data", resultList);
    }
}
